package com.ccys.cms.controller.masterData;

import com.ccys.cms.service.masterData.DiagnosisListDetailService;
import com.ccys.cms.service.masterData.DiagnosisListService;
import com.ccys.common.constants.TouristApi;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.masterData.*;
import com.ccys.db.vo.masterData.DiagnosisListDetailPageQueryVo;
import com.ccys.db.vo.masterData.DiagnosisListPageQueryVo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: WhiteCoat
 * @description: 诊断集合接口
 * @author: ZhangJingCan
 * @create: 2023-12-12 17:28
 **/

@RestController
@RequestMapping("masterData")
@Api(tags = "masterData-诊断集合接口(包含集合详情)")
public class DiagnosisListController {

    /**
     * 诊断集合Service
     */
    @Autowired
    private DiagnosisListService diagnosisListService;

    /**
     * 集合详情
     */
    @Autowired
    private DiagnosisListDetailService diagnosisListDetailService;


    
    @PostMapping("diagnosisList")
    @ApiOperation("保存诊断集合")
    public ResponseResult saveDiagnosisList(DiagnosisListSaveDto dto) {
        return diagnosisListService.saveDiagnosisList(dto);
    }

    @PutMapping("diagnosisList")
    @ApiOperation("保存诊断集合")
    public ResponseResult editDiagnosisList(DiagnosisListSaveDto dto) {
        return diagnosisListService.saveDiagnosisList(dto);
    }

    
    @DeleteMapping("diagnosisList")
    @ApiOperation("根据ID删除诊断集合")
    public ResponseResult deleteDiagnosisList(DiagnosisListDelDto dto) {
        return diagnosisListService.deleteDiagnosisList(dto);
    }

    
    @GetMapping("diagnosisList")
    @ApiOperation("分页查询诊断集合")
    public ResponseResult<PageInfo<DiagnosisListPageQueryVo>, Object> findPageDiagnosisList(DiagnosisListPageQueryDto dto) {
        return diagnosisListService.findPageDiagnosisList(dto);
    }

    //==================================上面是集合================下面是集合详情

    
    @PostMapping("diagnosisListDetail")
    @ApiOperation("保存诊断集合详情")
    public ResponseResult saveDiagnosisListDetail(DiagnosisListDetailSaveDto dto) {
        return diagnosisListDetailService.saveDiagnosisListDetail(dto);
    }

    
    @DeleteMapping("diagnosisListDetail")
    @ApiOperation("根据ID删除诊断集合详情")
    public ResponseResult deleteDiagnosisListDetail(DiagnosisListDetailDelDto dto) {
        return diagnosisListDetailService.deleteDiagnosisListDetail(dto);
    }

    
    @GetMapping("diagnosisListDetail")
    @ApiOperation("分页查询诊断集合详情")
    public ResponseResult<PageInfo<DiagnosisListDetailPageQueryVo>, Object> findPageDiagnosisListDetail(DiagnosisListDetailPageQueryDto dto) {
        return diagnosisListDetailService.findPageDiagnosisListDetail(dto);
    }


}
